package com.shj.util;

/**
 * @author songhuajian
 * @Description: TODO
 * @date 2020/6/16 17:29
 **/
public class StringUtil {

    public static String replaceZero(String s) {
        //判断是否有小数点
        if (s.indexOf(".") > 0) {
            //去掉多余的0
            s = s.replaceAll("0+?$", "");
            //如最后一位是.则去掉
            s = s.replaceAll("[.]$", "");
        }
        return s;
    }
}
